\(\int \frac {(A+B \sin (e+f x)) (c+d \sin (e+f x))^3}{a+a \sin (e+f x)} \, dx\) [265]

   Optimal result
   Rubi [A] (verified)
   Mathematica [B] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [B] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 35, antiderivative size = 220 \[ \int \frac {(A+B \sin (e+f x)) (c+d \sin (e+f x))^3}{a+a \sin (e+f x)} \, dx=\frac {\left (3 A d \left (2 c^2-2 c d+d^2\right )+B \left (2 c^3-6 c^2 d+9 c d^2-3 d^3\right )\right ) x}{2 a}+\frac {2 d \left (3 A \left (c^2-3 c d+d^2\right )-B \left (7 c^2-9 c d+4 d^2\right )\right ) \cos (e+f x)}{3 a f}+\frac {d^2 (6 A c-11 B c-9 A d+9 B d) \cos (e+f x) \sin (e+f x)}{6 a f}+\frac {(3 A-4 B) d \cos (e+f x) (c+d \sin (e+f x))^2}{3 a f}-\frac {(A-B) \cos (e+f x) (c+d \sin (e+f x))^3}{f (a+a \sin (e+f x))} \]

[Out]

1/2*(3*A*d*(2*c^2-2*c*d+d^2)+B*(2*c^3-6*c^2*d+9*c*d^2-3*d^3))*x/a+2/3*d*(3*A*(c^2-3*c*d+d^2)-B*(7*c^2-9*c*d+4*
d^2))*cos(f*x+e)/a/f+1/6*d^2*(6*A*c-9*A*d-11*B*c+9*B*d)*cos(f*x+e)*sin(f*x+e)/a/f+1/3*(3*A-4*B)*d*cos(f*x+e)*(
c+d*sin(f*x+e))^2/a/f-(A-B)*cos(f*x+e)*(c+d*sin(f*x+e))^3/f/(a+a*sin(f*x+e))

Rubi [A] (verified)

Time = 0.25 (sec) , antiderivative size = 220, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.086, Rules used = {3056, 2832, 2813} \[ \int \frac {(A+B \sin (e+f x)) (c+d \sin (e+f x))^3}{a+a \sin (e+f x)} \, dx=\frac {2 d \left (3 A \left (c^2-3 c d+d^2\right )-B \left (7 c^2-9 c d+4 d^2\right )\right ) \cos (e+f x)}{3 a f}+\frac {x \left (3 A d \left (2 c^2-2 c d+d^2\right )+B \left (2 c^3-6 c^2 d+9 c d^2-3 d^3\right )\right )}{2 a}+\frac {d^2 (6 A c-9 A d-11 B c+9 B d) \sin (e+f x) \cos (e+f x)}{6 a f}-\frac {(A-B) \cos (e+f x) (c+d \sin (e+f x))^3}{f (a \sin (e+f x)+a)}+\frac {d (3 A-4 B) \cos (e+f x) (c+d \sin (e+f x))^2}{3 a f} \]

[In]

Int[((A + B*Sin[e + f*x])*(c + d*Sin[e + f*x])^3)/(a + a*Sin[e + f*x]),x]

[Out]

((3*A*d*(2*c^2 - 2*c*d + d^2) + B*(2*c^3 - 6*c^2*d + 9*c*d^2 - 3*d^3))*x)/(2*a) + (2*d*(3*A*(c^2 - 3*c*d + d^2
) - B*(7*c^2 - 9*c*d + 4*d^2))*Cos[e + f*x])/(3*a*f) + (d^2*(6*A*c - 11*B*c - 9*A*d + 9*B*d)*Cos[e + f*x]*Sin[
e + f*x])/(6*a*f) + ((3*A - 4*B)*d*Cos[e + f*x]*(c + d*Sin[e + f*x])^2)/(3*a*f) - ((A - B)*Cos[e + f*x]*(c + d
*Sin[e + f*x])^3)/(f*(a + a*Sin[e + f*x]))

Rule 2813

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(2*a*c +
 b*d)*(x/2), x] + (-Simp[(b*c + a*d)*(Cos[e + f*x]/f), x] - Simp[b*d*Cos[e + f*x]*(Sin[e + f*x]/(2*f)), x]) /;
 FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0]

Rule 2832

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(-d
)*Cos[e + f*x]*((a + b*Sin[e + f*x])^m/(f*(m + 1))), x] + Dist[1/(m + 1), Int[(a + b*Sin[e + f*x])^(m - 1)*Sim
p[b*d*m + a*c*(m + 1) + (a*d*m + b*c*(m + 1))*Sin[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[
b*c - a*d, 0] && NeQ[a^2 - b^2, 0] && GtQ[m, 0] && IntegerQ[2*m]

Rule 3056

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*sin[(e_
.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[(A*b - a*B)*Cos[e + f*x]*(a + b*Sin[e + f*x])^m*((c + d*Sin[e + f*x]
)^n/(a*f*(2*m + 1))), x] - Dist[1/(a*b*(2*m + 1)), Int[(a + b*Sin[e + f*x])^(m + 1)*(c + d*Sin[e + f*x])^(n -
1)*Simp[A*(a*d*n - b*c*(m + 1)) - B*(a*c*m + b*d*n) - d*(a*B*(m - n) + A*b*(m + n + 1))*Sin[e + f*x], x], x],
x] /; FreeQ[{a, b, c, d, e, f, A, B}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0] && LtQ
[m, -2^(-1)] && GtQ[n, 0] && IntegerQ[2*m] && (IntegerQ[2*n] || EqQ[c, 0])

Rubi steps \begin{align*} \text {integral}& = -\frac {(A-B) \cos (e+f x) (c+d \sin (e+f x))^3}{f (a+a \sin (e+f x))}+\frac {\int (c+d \sin (e+f x))^2 (a (B (c-3 d)+3 A d)-a (3 A-4 B) d \sin (e+f x)) \, dx}{a^2} \\ & = \frac {(3 A-4 B) d \cos (e+f x) (c+d \sin (e+f x))^2}{3 a f}-\frac {(A-B) \cos (e+f x) (c+d \sin (e+f x))^3}{f (a+a \sin (e+f x))}+\frac {\int (c+d \sin (e+f x)) \left (a \left (3 A (3 c-2 d) d+B \left (3 c^2-9 c d+8 d^2\right )\right )-a d (6 A c-11 B c-9 A d+9 B d) \sin (e+f x)\right ) \, dx}{3 a^2} \\ & = \frac {\left (3 A d \left (2 c^2-2 c d+d^2\right )+B \left (2 c^3-6 c^2 d+9 c d^2-3 d^3\right )\right ) x}{2 a}+\frac {2 d \left (3 A \left (c^2-3 c d+d^2\right )-B \left (7 c^2-9 c d+4 d^2\right )\right ) \cos (e+f x)}{3 a f}+\frac {d^2 (6 A c-11 B c-9 A d+9 B d) \cos (e+f x) \sin (e+f x)}{6 a f}+\frac {(3 A-4 B) d \cos (e+f x) (c+d \sin (e+f x))^2}{3 a f}-\frac {(A-B) \cos (e+f x) (c+d \sin (e+f x))^3}{f (a+a \sin (e+f x))} \\ \end{align*}

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(788\) vs. \(2(220)=440\).

Time = 7.02 (sec) , antiderivative size = 788, normalized size of antiderivative = 3.58 \[ \int \frac {(A+B \sin (e+f x)) (c+d \sin (e+f x))^3}{a+a \sin (e+f x)} \, dx=\frac {\left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right ) \left (3 \left (4 A d \left (6 c^2 (e+f x)-3 c d (1+2 e+2 f x)+d^2 (1+3 e+3 f x)\right )+B \left (8 c^3 (e+f x)-12 c^2 d (1+2 e+2 f x)+12 c d^2 (1+3 e+3 f x)-d^3 (7+12 e+12 f x)\right )\right ) \cos \left (\frac {1}{2} (e+f x)\right )+9 d \left (A d (-4 c+d)+B \left (-4 c^2+3 c d-2 d^2\right )\right ) \cos \left (\frac {3}{2} (e+f x)\right )+9 B c d^2 \cos \left (\frac {5}{2} (e+f x)\right )+3 A d^3 \cos \left (\frac {5}{2} (e+f x)\right )-2 B d^3 \cos \left (\frac {5}{2} (e+f x)\right )+B d^3 \cos \left (\frac {7}{2} (e+f x)\right )+48 A c^3 \sin \left (\frac {1}{2} (e+f x)\right )-48 B c^3 \sin \left (\frac {1}{2} (e+f x)\right )-144 A c^2 d \sin \left (\frac {1}{2} (e+f x)\right )+180 B c^2 d \sin \left (\frac {1}{2} (e+f x)\right )+180 A c d^2 \sin \left (\frac {1}{2} (e+f x)\right )-180 B c d^2 \sin \left (\frac {1}{2} (e+f x)\right )-60 A d^3 \sin \left (\frac {1}{2} (e+f x)\right )+69 B d^3 \sin \left (\frac {1}{2} (e+f x)\right )+24 B c^3 e \sin \left (\frac {1}{2} (e+f x)\right )+72 A c^2 d e \sin \left (\frac {1}{2} (e+f x)\right )-72 B c^2 d e \sin \left (\frac {1}{2} (e+f x)\right )-72 A c d^2 e \sin \left (\frac {1}{2} (e+f x)\right )+108 B c d^2 e \sin \left (\frac {1}{2} (e+f x)\right )+36 A d^3 e \sin \left (\frac {1}{2} (e+f x)\right )-36 B d^3 e \sin \left (\frac {1}{2} (e+f x)\right )+24 B c^3 f x \sin \left (\frac {1}{2} (e+f x)\right )+72 A c^2 d f x \sin \left (\frac {1}{2} (e+f x)\right )-72 B c^2 d f x \sin \left (\frac {1}{2} (e+f x)\right )-72 A c d^2 f x \sin \left (\frac {1}{2} (e+f x)\right )+108 B c d^2 f x \sin \left (\frac {1}{2} (e+f x)\right )+36 A d^3 f x \sin \left (\frac {1}{2} (e+f x)\right )-36 B d^3 f x \sin \left (\frac {1}{2} (e+f x)\right )-36 B c^2 d \sin \left (\frac {3}{2} (e+f x)\right )-36 A c d^2 \sin \left (\frac {3}{2} (e+f x)\right )+27 B c d^2 \sin \left (\frac {3}{2} (e+f x)\right )+9 A d^3 \sin \left (\frac {3}{2} (e+f x)\right )-18 B d^3 \sin \left (\frac {3}{2} (e+f x)\right )-9 B c d^2 \sin \left (\frac {5}{2} (e+f x)\right )-3 A d^3 \sin \left (\frac {5}{2} (e+f x)\right )+2 B d^3 \sin \left (\frac {5}{2} (e+f x)\right )+B d^3 \sin \left (\frac {7}{2} (e+f x)\right )\right )}{24 a f (1+\sin (e+f x))} \]

[In]

Integrate[((A + B*Sin[e + f*x])*(c + d*Sin[e + f*x])^3)/(a + a*Sin[e + f*x]),x]

[Out]

((Cos[(e + f*x)/2] + Sin[(e + f*x)/2])*(3*(4*A*d*(6*c^2*(e + f*x) - 3*c*d*(1 + 2*e + 2*f*x) + d^2*(1 + 3*e + 3
*f*x)) + B*(8*c^3*(e + f*x) - 12*c^2*d*(1 + 2*e + 2*f*x) + 12*c*d^2*(1 + 3*e + 3*f*x) - d^3*(7 + 12*e + 12*f*x
)))*Cos[(e + f*x)/2] + 9*d*(A*d*(-4*c + d) + B*(-4*c^2 + 3*c*d - 2*d^2))*Cos[(3*(e + f*x))/2] + 9*B*c*d^2*Cos[
(5*(e + f*x))/2] + 3*A*d^3*Cos[(5*(e + f*x))/2] - 2*B*d^3*Cos[(5*(e + f*x))/2] + B*d^3*Cos[(7*(e + f*x))/2] +
48*A*c^3*Sin[(e + f*x)/2] - 48*B*c^3*Sin[(e + f*x)/2] - 144*A*c^2*d*Sin[(e + f*x)/2] + 180*B*c^2*d*Sin[(e + f*
x)/2] + 180*A*c*d^2*Sin[(e + f*x)/2] - 180*B*c*d^2*Sin[(e + f*x)/2] - 60*A*d^3*Sin[(e + f*x)/2] + 69*B*d^3*Sin
[(e + f*x)/2] + 24*B*c^3*e*Sin[(e + f*x)/2] + 72*A*c^2*d*e*Sin[(e + f*x)/2] - 72*B*c^2*d*e*Sin[(e + f*x)/2] -
72*A*c*d^2*e*Sin[(e + f*x)/2] + 108*B*c*d^2*e*Sin[(e + f*x)/2] + 36*A*d^3*e*Sin[(e + f*x)/2] - 36*B*d^3*e*Sin[
(e + f*x)/2] + 24*B*c^3*f*x*Sin[(e + f*x)/2] + 72*A*c^2*d*f*x*Sin[(e + f*x)/2] - 72*B*c^2*d*f*x*Sin[(e + f*x)/
2] - 72*A*c*d^2*f*x*Sin[(e + f*x)/2] + 108*B*c*d^2*f*x*Sin[(e + f*x)/2] + 36*A*d^3*f*x*Sin[(e + f*x)/2] - 36*B
*d^3*f*x*Sin[(e + f*x)/2] - 36*B*c^2*d*Sin[(3*(e + f*x))/2] - 36*A*c*d^2*Sin[(3*(e + f*x))/2] + 27*B*c*d^2*Sin
[(3*(e + f*x))/2] + 9*A*d^3*Sin[(3*(e + f*x))/2] - 18*B*d^3*Sin[(3*(e + f*x))/2] - 9*B*c*d^2*Sin[(5*(e + f*x))
/2] - 3*A*d^3*Sin[(5*(e + f*x))/2] + 2*B*d^3*Sin[(5*(e + f*x))/2] + B*d^3*Sin[(7*(e + f*x))/2]))/(24*a*f*(1 +
Sin[e + f*x]))

Maple [A] (verified)

Time = 0.86 (sec) , antiderivative size = 337, normalized size of antiderivative = 1.53

method result size
derivativedivides \(\frac {\frac {2 \left (\left (\frac {1}{2} A \,d^{3}+\frac {3}{2} d^{2} c B -\frac {1}{2} d^{3} B \right ) \left (\tan ^{5}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )+\left (-3 d^{2} c A +A \,d^{3}-3 c^{2} d B +3 d^{2} c B -d^{3} B \right ) \left (\tan ^{4}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )+\left (-6 d^{2} c A +2 A \,d^{3}-6 c^{2} d B +6 d^{2} c B -4 d^{3} B \right ) \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )+\left (-\frac {1}{2} A \,d^{3}-\frac {3}{2} d^{2} c B +\frac {1}{2} d^{3} B \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )-3 d^{2} c A +A \,d^{3}-3 c^{2} d B +3 d^{2} c B -\frac {5 d^{3} B}{3}\right )}{\left (1+\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )^{3}}+\left (6 c^{2} d A -6 d^{2} c A +3 A \,d^{3}+2 B \,c^{3}-6 c^{2} d B +9 d^{2} c B -3 d^{3} B \right ) \arctan \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right )-\frac {2 \left (A \,c^{3}-3 c^{2} d A +3 d^{2} c A -A \,d^{3}-B \,c^{3}+3 c^{2} d B -3 d^{2} c B +d^{3} B \right )}{\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1}}{a f}\) \(337\)
default \(\frac {\frac {2 \left (\left (\frac {1}{2} A \,d^{3}+\frac {3}{2} d^{2} c B -\frac {1}{2} d^{3} B \right ) \left (\tan ^{5}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )+\left (-3 d^{2} c A +A \,d^{3}-3 c^{2} d B +3 d^{2} c B -d^{3} B \right ) \left (\tan ^{4}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )+\left (-6 d^{2} c A +2 A \,d^{3}-6 c^{2} d B +6 d^{2} c B -4 d^{3} B \right ) \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )+\left (-\frac {1}{2} A \,d^{3}-\frac {3}{2} d^{2} c B +\frac {1}{2} d^{3} B \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )-3 d^{2} c A +A \,d^{3}-3 c^{2} d B +3 d^{2} c B -\frac {5 d^{3} B}{3}\right )}{\left (1+\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )^{3}}+\left (6 c^{2} d A -6 d^{2} c A +3 A \,d^{3}+2 B \,c^{3}-6 c^{2} d B +9 d^{2} c B -3 d^{3} B \right ) \arctan \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right )-\frac {2 \left (A \,c^{3}-3 c^{2} d A +3 d^{2} c A -A \,d^{3}-B \,c^{3}+3 c^{2} d B -3 d^{2} c B +d^{3} B \right )}{\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1}}{a f}\) \(337\)
parallelrisch \(\frac {\left (\left (36 f x A -36 f x B +84 A -109 B \right ) d^{3}-72 c \left (\frac {\left (-3 f x -7\right ) B}{2}+A \left (f x +\frac {7}{2}\right )\right ) d^{2}+72 \left (\left (-f x -\frac {7}{2}\right ) B +A \left (f x +2\right )\right ) c^{2} d -48 \left (\left (-\frac {f x}{2}-1\right ) B +A \right ) c^{3}\right ) \cos \left (\frac {f x}{2}+\frac {e}{2}\right )+\left (\left (36 f x A -36 f x B +12 A -19 B \right ) d^{3}-72 c \left (\frac {\left (-3 f x -1\right ) B}{2}+A \left (f x +\frac {1}{2}\right )\right ) d^{2}+72 \left (\left (-f x -\frac {1}{2}\right ) B +f x A \right ) c^{2} d +24 B \,c^{3} f x \right ) \sin \left (\frac {f x}{2}+\frac {e}{2}\right )-36 \left (\left (\frac {\left (-\frac {A}{2}+B \right ) d^{2}}{2}+c \left (A -\frac {3 B}{4}\right ) d +B \,c^{2}\right ) \cos \left (\frac {3 f x}{2}+\frac {3 e}{2}\right )+\left (\frac {\left (-\frac {A}{2}+B \right ) d^{2}}{2}+c \left (A -\frac {3 B}{4}\right ) d +B \,c^{2}\right ) \sin \left (\frac {3 f x}{2}+\frac {3 e}{2}\right )-\frac {\left (\left (\left (A -\frac {2 B}{3}\right ) d +3 B c \right ) \cos \left (\frac {5 f x}{2}+\frac {5 e}{2}\right )+\left (\left (-A +\frac {2 B}{3}\right ) d -3 B c \right ) \sin \left (\frac {5 f x}{2}+\frac {5 e}{2}\right )+\frac {d B \left (\cos \left (\frac {7 f x}{2}+\frac {7 e}{2}\right )+\sin \left (\frac {7 f x}{2}+\frac {7 e}{2}\right )\right )}{3}\right ) d}{12}\right ) d}{24 \left (\sin \left (\frac {f x}{2}+\frac {e}{2}\right )+\cos \left (\frac {f x}{2}+\frac {e}{2}\right )\right ) a f}\) \(350\)
risch \(-\frac {d^{3} \sin \left (2 f x +2 e \right ) A}{4 a f}+\frac {3 x A \,d^{3}}{2 a}+\frac {x B \,c^{3}}{a}-\frac {3 x \,d^{3} B}{2 a}+\frac {3 x \,c^{2} d A}{a}-\frac {3 x \,d^{2} c A}{a}-\frac {3 x \,c^{2} d B}{a}+\frac {9 x \,d^{2} c B}{2 a}+\frac {B \,d^{3} \cos \left (3 f x +3 e \right )}{12 a f}+\frac {d^{3} \sin \left (2 f x +2 e \right ) B}{4 a f}-\frac {3 d^{2} \sin \left (2 f x +2 e \right ) B c}{4 a f}+\frac {d^{3} {\mathrm e}^{i \left (f x +e \right )} A}{2 a f}-\frac {7 d^{3} {\mathrm e}^{i \left (f x +e \right )} B}{8 a f}+\frac {d^{3} {\mathrm e}^{-i \left (f x +e \right )} A}{2 a f}-\frac {7 d^{3} {\mathrm e}^{-i \left (f x +e \right )} B}{8 a f}-\frac {2 A \,c^{3}}{f a \left ({\mathrm e}^{i \left (f x +e \right )}+i\right )}+\frac {2 A \,d^{3}}{f a \left ({\mathrm e}^{i \left (f x +e \right )}+i\right )}+\frac {2 B \,c^{3}}{f a \left ({\mathrm e}^{i \left (f x +e \right )}+i\right )}-\frac {2 d^{3} B}{f a \left ({\mathrm e}^{i \left (f x +e \right )}+i\right )}-\frac {6 c^{2} d B}{f a \left ({\mathrm e}^{i \left (f x +e \right )}+i\right )}+\frac {6 d^{2} c B}{f a \left ({\mathrm e}^{i \left (f x +e \right )}+i\right )}-\frac {3 d^{2} {\mathrm e}^{i \left (f x +e \right )} A c}{2 a f}-\frac {3 d \,{\mathrm e}^{i \left (f x +e \right )} B \,c^{2}}{2 a f}+\frac {3 d^{2} {\mathrm e}^{i \left (f x +e \right )} c B}{2 a f}-\frac {3 d^{2} {\mathrm e}^{-i \left (f x +e \right )} A c}{2 a f}-\frac {3 d \,{\mathrm e}^{-i \left (f x +e \right )} B \,c^{2}}{2 a f}+\frac {3 d^{2} {\mathrm e}^{-i \left (f x +e \right )} c B}{2 a f}+\frac {6 c^{2} d A}{f a \left ({\mathrm e}^{i \left (f x +e \right )}+i\right )}-\frac {6 d^{2} c A}{f a \left ({\mathrm e}^{i \left (f x +e \right )}+i\right )}\) \(588\)
norman \(\text {Expression too large to display}\) \(1198\)

[In]

int((A+B*sin(f*x+e))*(c+d*sin(f*x+e))^3/(a+a*sin(f*x+e)),x,method=_RETURNVERBOSE)

[Out]

2/f/a*(((1/2*A*d^3+3/2*d^2*c*B-1/2*d^3*B)*tan(1/2*f*x+1/2*e)^5+(-3*A*c*d^2+A*d^3-3*B*c^2*d+3*B*c*d^2-B*d^3)*ta
n(1/2*f*x+1/2*e)^4+(-6*A*c*d^2+2*A*d^3-6*B*c^2*d+6*B*c*d^2-4*B*d^3)*tan(1/2*f*x+1/2*e)^2+(-1/2*A*d^3-3/2*d^2*c
*B+1/2*d^3*B)*tan(1/2*f*x+1/2*e)-3*d^2*c*A+A*d^3-3*c^2*d*B+3*d^2*c*B-5/3*d^3*B)/(1+tan(1/2*f*x+1/2*e)^2)^3+1/2
*(6*A*c^2*d-6*A*c*d^2+3*A*d^3+2*B*c^3-6*B*c^2*d+9*B*c*d^2-3*B*d^3)*arctan(tan(1/2*f*x+1/2*e))-(A*c^3-3*A*c^2*d
+3*A*c*d^2-A*d^3-B*c^3+3*B*c^2*d-3*B*c*d^2+B*d^3)/(tan(1/2*f*x+1/2*e)+1))

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 470 vs. \(2 (212) = 424\).

Time = 0.28 (sec) , antiderivative size = 470, normalized size of antiderivative = 2.14 \[ \int \frac {(A+B \sin (e+f x)) (c+d \sin (e+f x))^3}{a+a \sin (e+f x)} \, dx=\frac {2 \, B d^{3} \cos \left (f x + e\right )^{4} - 6 \, {\left (A - B\right )} c^{3} + 18 \, {\left (A - B\right )} c^{2} d - 18 \, {\left (A - B\right )} c d^{2} + 6 \, {\left (A - B\right )} d^{3} + {\left (9 \, B c d^{2} + {\left (3 \, A - B\right )} d^{3}\right )} \cos \left (f x + e\right )^{3} + 3 \, {\left (2 \, B c^{3} + 6 \, {\left (A - B\right )} c^{2} d - 3 \, {\left (2 \, A - 3 \, B\right )} c d^{2} + 3 \, {\left (A - B\right )} d^{3}\right )} f x - 6 \, {\left (3 \, B c^{2} d + 3 \, {\left (A - B\right )} c d^{2} - {\left (A - 2 \, B\right )} d^{3}\right )} \cos \left (f x + e\right )^{2} - 3 \, {\left (2 \, {\left (A - B\right )} c^{3} - 6 \, {\left (A - 2 \, B\right )} c^{2} d + 3 \, {\left (4 \, A - 3 \, B\right )} c d^{2} - {\left (3 \, A - 5 \, B\right )} d^{3} - {\left (2 \, B c^{3} + 6 \, {\left (A - B\right )} c^{2} d - 3 \, {\left (2 \, A - 3 \, B\right )} c d^{2} + 3 \, {\left (A - B\right )} d^{3}\right )} f x\right )} \cos \left (f x + e\right ) + {\left (2 \, B d^{3} \cos \left (f x + e\right )^{3} + 6 \, {\left (A - B\right )} c^{3} - 18 \, {\left (A - B\right )} c^{2} d + 18 \, {\left (A - B\right )} c d^{2} - 6 \, {\left (A - B\right )} d^{3} + 3 \, {\left (2 \, B c^{3} + 6 \, {\left (A - B\right )} c^{2} d - 3 \, {\left (2 \, A - 3 \, B\right )} c d^{2} + 3 \, {\left (A - B\right )} d^{3}\right )} f x - 3 \, {\left (3 \, B c d^{2} + {\left (A - B\right )} d^{3}\right )} \cos \left (f x + e\right )^{2} - 3 \, {\left (6 \, B c^{2} d + 3 \, {\left (2 \, A - B\right )} c d^{2} - {\left (A - 3 \, B\right )} d^{3}\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )}{6 \, {\left (a f \cos \left (f x + e\right ) + a f \sin \left (f x + e\right ) + a f\right )}} \]

[In]

integrate((A+B*sin(f*x+e))*(c+d*sin(f*x+e))^3/(a+a*sin(f*x+e)),x, algorithm="fricas")

[Out]

1/6*(2*B*d^3*cos(f*x + e)^4 - 6*(A - B)*c^3 + 18*(A - B)*c^2*d - 18*(A - B)*c*d^2 + 6*(A - B)*d^3 + (9*B*c*d^2
 + (3*A - B)*d^3)*cos(f*x + e)^3 + 3*(2*B*c^3 + 6*(A - B)*c^2*d - 3*(2*A - 3*B)*c*d^2 + 3*(A - B)*d^3)*f*x - 6
*(3*B*c^2*d + 3*(A - B)*c*d^2 - (A - 2*B)*d^3)*cos(f*x + e)^2 - 3*(2*(A - B)*c^3 - 6*(A - 2*B)*c^2*d + 3*(4*A
- 3*B)*c*d^2 - (3*A - 5*B)*d^3 - (2*B*c^3 + 6*(A - B)*c^2*d - 3*(2*A - 3*B)*c*d^2 + 3*(A - B)*d^3)*f*x)*cos(f*
x + e) + (2*B*d^3*cos(f*x + e)^3 + 6*(A - B)*c^3 - 18*(A - B)*c^2*d + 18*(A - B)*c*d^2 - 6*(A - B)*d^3 + 3*(2*
B*c^3 + 6*(A - B)*c^2*d - 3*(2*A - 3*B)*c*d^2 + 3*(A - B)*d^3)*f*x - 3*(3*B*c*d^2 + (A - B)*d^3)*cos(f*x + e)^
2 - 3*(6*B*c^2*d + 3*(2*A - B)*c*d^2 - (A - 3*B)*d^3)*cos(f*x + e))*sin(f*x + e))/(a*f*cos(f*x + e) + a*f*sin(
f*x + e) + a*f)

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 14644 vs. \(2 (204) = 408\).

Time = 3.87 (sec) , antiderivative size = 14644, normalized size of antiderivative = 66.56 \[ \int \frac {(A+B \sin (e+f x)) (c+d \sin (e+f x))^3}{a+a \sin (e+f x)} \, dx=\text {Too large to display} \]

[In]

integrate((A+B*sin(f*x+e))*(c+d*sin(f*x+e))**3/(a+a*sin(f*x+e)),x)

[Out]

Piecewise((-12*A*c**3*tan(e/2 + f*x/2)**6/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(
e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f
*tan(e/2 + f*x/2) + 6*a*f) - 36*A*c**3*tan(e/2 + f*x/2)**4/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)
**6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 +
f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) - 36*A*c**3*tan(e/2 + f*x/2)**2/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f
*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 +
18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) - 12*A*c**3/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*ta
n(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*
a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) + 18*A*c**2*d*f*x*tan(e/2 + f*x/2)**7/(6*a*f*tan(e/2
 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*ta
n(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) + 18*A*c**2*d*f*x*tan(e/2 + f
*x/2)**6/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2
+ f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) + 54*A
*c**2*d*f*x*tan(e/2 + f*x/2)**5/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/
2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 +
 f*x/2) + 6*a*f) + 54*A*c**2*d*f*x*tan(e/2 + f*x/2)**4/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6
+ 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/
2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) + 54*A*c**2*d*f*x*tan(e/2 + f*x/2)**3/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a
*f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3
+ 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) + 54*A*c**2*d*f*x*tan(e/2 + f*x/2)**2/(6*a*f*ta
n(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a
*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) + 18*A*c**2*d*f*x*tan(e/
2 + f*x/2)/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/
2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) + 18
*A*c**2*d*f*x/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan
(e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) +
 36*A*c**2*d*tan(e/2 + f*x/2)**6/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x
/2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2
+ f*x/2) + 6*a*f) + 108*A*c**2*d*tan(e/2 + f*x/2)**4/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 +
18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)
**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) + 108*A*c**2*d*tan(e/2 + f*x/2)**2/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*ta
n(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*
a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) + 36*A*c**2*d/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan
(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a
*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) - 18*A*c*d**2*f*x*tan(e/2 + f*x/2)**7/(6*a*f*tan(e/2
+ f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*tan
(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) - 18*A*c*d**2*f*x*tan(e/2 + f*
x/2)**6/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 +
 f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) - 54*A*
c*d**2*f*x*tan(e/2 + f*x/2)**5/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2
)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 +
f*x/2) + 6*a*f) - 54*A*c*d**2*f*x*tan(e/2 + f*x/2)**4/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 +
 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2
)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) - 54*A*c*d**2*f*x*tan(e/2 + f*x/2)**3/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*
f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 +
 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) - 54*A*c*d**2*f*x*tan(e/2 + f*x/2)**2/(6*a*f*tan
(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*
f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) - 18*A*c*d**2*f*x*tan(e/2
 + f*x/2)/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2
 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) - 18*
A*c*d**2*f*x/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(
e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) -
36*A*c*d**2*tan(e/2 + f*x/2)**6/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/
2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 +
 f*x/2) + 6*a*f) - 36*A*c*d**2*tan(e/2 + f*x/2)**5/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18
*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**
2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) - 144*A*c*d**2*tan(e/2 + f*x/2)**4/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(
e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*
f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) - 72*A*c*d**2*tan(e/2 + f*x/2)**3/(6*a*f*tan(e/2 + f*x
/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*tan(e/2
+ f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) - 180*A*c*d**2*tan(e/2 + f*x/2)**2/
(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*x/2)*
*4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) - 36*A*c*d**2*t
an(e/2 + f*x/2)/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*t
an(e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f)
 - 72*A*c*d**2/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*ta
n(e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f)
+ 9*A*d**3*f*x*tan(e/2 + f*x/2)**7/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f
*x/2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/
2 + f*x/2) + 6*a*f) + 9*A*d**3*f*x*tan(e/2 + f*x/2)**6/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6
+ 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/
2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) + 27*A*d**3*f*x*tan(e/2 + f*x/2)**5/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f
*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 +
18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) + 27*A*d**3*f*x*tan(e/2 + f*x/2)**4/(6*a*f*tan(e/
2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*t
an(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) + 27*A*d**3*f*x*tan(e/2 + f*
x/2)**3/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 +
 f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) + 27*A*
d**3*f*x*tan(e/2 + f*x/2)**2/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2)*
*5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*
x/2) + 6*a*f) + 9*A*d**3*f*x*tan(e/2 + f*x/2)/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*
tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6
*a*f*tan(e/2 + f*x/2) + 6*a*f) + 9*A*d**3*f*x/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*
tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6
*a*f*tan(e/2 + f*x/2) + 6*a*f) + 18*A*d**3*tan(e/2 + f*x/2)**6/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*
x/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/
2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) + 18*A*d**3*tan(e/2 + f*x/2)**5/(6*a*f*tan(e/2 + f*x/2)**7 + 6
*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**
3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) + 48*A*d**3*tan(e/2 + f*x/2)**4/(6*a*f*tan(e/
2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*t
an(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) + 24*A*d**3*tan(e/2 + f*x/2)
**3/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*x
/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) + 54*A*d**3
*tan(e/2 + f*x/2)**2/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*
a*f*tan(e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6
*a*f) + 6*A*d**3*tan(e/2 + f*x/2)/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*
x/2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2
 + f*x/2) + 6*a*f) + 24*A*d**3/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2
)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 +
f*x/2) + 6*a*f) + 6*B*c**3*f*x*tan(e/2 + f*x/2)**7/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18
*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**
2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) + 6*B*c**3*f*x*tan(e/2 + f*x/2)**6/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(
e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*
f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) + 18*B*c**3*f*x*tan(e/2 + f*x/2)**5/(6*a*f*tan(e/2 + f
*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*tan(e/
2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) + 18*B*c**3*f*x*tan(e/2 + f*x/2)*
*4/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*x/
2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) + 18*B*c**3*
f*x*tan(e/2 + f*x/2)**3/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5 +
18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2)
+ 6*a*f) + 18*B*c**3*f*x*tan(e/2 + f*x/2)**2/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*t
an(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6*
a*f*tan(e/2 + f*x/2) + 6*a*f) + 6*B*c**3*f*x*tan(e/2 + f*x/2)/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x
/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2
 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) + 6*B*c**3*f*x/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x
/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2
 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) + 12*B*c**3*tan(e/2 + f*x/2)**6/(6*a*f*tan(e/2 + f*x/2)**7 + 6*
a*f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3
 + 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) + 36*B*c**3*tan(e/2 + f*x/2)**4/(6*a*f*tan(e/2
 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*ta
n(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) + 36*B*c**3*tan(e/2 + f*x/2)*
*2/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*x/
2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) + 12*B*c**3/
(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*x/2)*
*4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) - 18*B*c**2*d*f
*x*tan(e/2 + f*x/2)**7/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5 + 1
8*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) +
 6*a*f) - 18*B*c**2*d*f*x*tan(e/2 + f*x/2)**6/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*
tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6
*a*f*tan(e/2 + f*x/2) + 6*a*f) - 54*B*c**2*d*f*x*tan(e/2 + f*x/2)**5/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/
2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*
tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) - 54*B*c**2*d*f*x*tan(e/2 + f*x/2)**4/(6*a*f*tan(e/2 + f
*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*tan(e/
2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) - 54*B*c**2*d*f*x*tan(e/2 + f*x/2
)**3/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*
x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) - 54*B*c**
2*d*f*x*tan(e/2 + f*x/2)**2/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2)**
5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x
/2) + 6*a*f) - 18*B*c**2*d*f*x*tan(e/2 + f*x/2)/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18*a*
f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**2 +
 6*a*f*tan(e/2 + f*x/2) + 6*a*f) - 18*B*c**2*d*f*x/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18
*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**
2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) - 36*B*c**2*d*tan(e/2 + f*x/2)**6/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e
/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f
*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) - 36*B*c**2*d*tan(e/2 + f*x/2)**5/(6*a*f*tan(e/2 + f*x/
2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*tan(e/2 +
 f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) - 144*B*c**2*d*tan(e/2 + f*x/2)**4/(
6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*x/2)**
4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) - 72*B*c**2*d*ta
n(e/2 + f*x/2)**3/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f
*tan(e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*
f) - 180*B*c**2*d*tan(e/2 + f*x/2)**2/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2
+ f*x/2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan
(e/2 + f*x/2) + 6*a*f) - 36*B*c**2*d*tan(e/2 + f*x/2)/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 +
 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2
)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) - 72*B*c**2*d/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 +
18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)
**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) + 27*B*c*d**2*f*x*tan(e/2 + f*x/2)**7/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f
*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 +
18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) + 27*B*c*d**2*f*x*tan(e/2 + f*x/2)**6/(6*a*f*tan(
e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f
*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) + 81*B*c*d**2*f*x*tan(e/2
+ f*x/2)**5/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e
/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) + 8
1*B*c*d**2*f*x*tan(e/2 + f*x/2)**4/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f
*x/2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/
2 + f*x/2) + 6*a*f) + 81*B*c*d**2*f*x*tan(e/2 + f*x/2)**3/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)*
*6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f
*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) + 81*B*c*d**2*f*x*tan(e/2 + f*x/2)**2/(6*a*f*tan(e/2 + f*x/2)**7 +
6*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)*
*3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) + 27*B*c*d**2*f*x*tan(e/2 + f*x/2)/(6*a*f*ta
n(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a
*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) + 27*B*c*d**2*f*x/(6*a*f
*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 1
8*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) + 54*B*c*d**2*tan(e/2
 + f*x/2)**6/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(
e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) +
54*B*c*d**2*tan(e/2 + f*x/2)**5/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/
2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 +
 f*x/2) + 6*a*f) + 144*B*c*d**2*tan(e/2 + f*x/2)**4/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 1
8*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)*
*2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) + 72*B*c*d**2*tan(e/2 + f*x/2)**3/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(
e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*
f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) + 162*B*c*d**2*tan(e/2 + f*x/2)**2/(6*a*f*tan(e/2 + f*
x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*tan(e/2
 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) + 18*B*c*d**2*tan(e/2 + f*x/2)/(6*
a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*x/2)**4
+ 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) + 72*B*c*d**2/(6*a
*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 +
 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) - 9*B*d**3*f*x*tan(
e/2 + f*x/2)**7/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*t
an(e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f)
 - 9*B*d**3*f*x*tan(e/2 + f*x/2)**6/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 +
f*x/2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e
/2 + f*x/2) + 6*a*f) - 27*B*d**3*f*x*tan(e/2 + f*x/2)**5/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**
6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*
x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) - 27*B*d**3*f*x*tan(e/2 + f*x/2)**4/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a
*f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3
+ 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) - 27*B*d**3*f*x*tan(e/2 + f*x/2)**3/(6*a*f*tan(
e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f
*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) - 27*B*d**3*f*x*tan(e/2 +
f*x/2)**2/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2
 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) - 9*B
*d**3*f*x*tan(e/2 + f*x/2)/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5
 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/
2) + 6*a*f) - 9*B*d**3*f*x/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5
 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/
2) + 6*a*f) - 18*B*d**3*tan(e/2 + f*x/2)**6/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*ta
n(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6*a
*f*tan(e/2 + f*x/2) + 6*a*f) - 18*B*d**3*tan(e/2 + f*x/2)**5/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/
2)**6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2
+ f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) - 48*B*d**3*tan(e/2 + f*x/2)**4/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a
*f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3
+ 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) - 48*B*d**3*tan(e/2 + f*x/2)**3/(6*a*f*tan(e/2
+ f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*x/2)**4 + 18*a*f*tan
(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) - 78*B*d**3*tan(e/2 + f*x/2)**
2/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(e/2 + f*x/2
)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f) - 14*B*d**3*t
an(e/2 + f*x/2)/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*t
an(e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f)
 - 32*B*d**3/(6*a*f*tan(e/2 + f*x/2)**7 + 6*a*f*tan(e/2 + f*x/2)**6 + 18*a*f*tan(e/2 + f*x/2)**5 + 18*a*f*tan(
e/2 + f*x/2)**4 + 18*a*f*tan(e/2 + f*x/2)**3 + 18*a*f*tan(e/2 + f*x/2)**2 + 6*a*f*tan(e/2 + f*x/2) + 6*a*f), N
e(f, 0)), (x*(A + B*sin(e))*(c + d*sin(e))**3/(a*sin(e) + a), True))

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 1124 vs. \(2 (212) = 424\).

Time = 0.32 (sec) , antiderivative size = 1124, normalized size of antiderivative = 5.11 \[ \int \frac {(A+B \sin (e+f x)) (c+d \sin (e+f x))^3}{a+a \sin (e+f x)} \, dx=\text {Too large to display} \]

[In]

integrate((A+B*sin(f*x+e))*(c+d*sin(f*x+e))^3/(a+a*sin(f*x+e)),x, algorithm="maxima")

[Out]

-1/3*(B*d^3*((7*sin(f*x + e)/(cos(f*x + e) + 1) + 39*sin(f*x + e)^2/(cos(f*x + e) + 1)^2 + 24*sin(f*x + e)^3/(
cos(f*x + e) + 1)^3 + 24*sin(f*x + e)^4/(cos(f*x + e) + 1)^4 + 9*sin(f*x + e)^5/(cos(f*x + e) + 1)^5 + 9*sin(f
*x + e)^6/(cos(f*x + e) + 1)^6 + 16)/(a + a*sin(f*x + e)/(cos(f*x + e) + 1) + 3*a*sin(f*x + e)^2/(cos(f*x + e)
 + 1)^2 + 3*a*sin(f*x + e)^3/(cos(f*x + e) + 1)^3 + 3*a*sin(f*x + e)^4/(cos(f*x + e) + 1)^4 + 3*a*sin(f*x + e)
^5/(cos(f*x + e) + 1)^5 + a*sin(f*x + e)^6/(cos(f*x + e) + 1)^6 + a*sin(f*x + e)^7/(cos(f*x + e) + 1)^7) + 9*a
rctan(sin(f*x + e)/(cos(f*x + e) + 1))/a) - 9*B*c*d^2*((sin(f*x + e)/(cos(f*x + e) + 1) + 5*sin(f*x + e)^2/(co
s(f*x + e) + 1)^2 + 3*sin(f*x + e)^3/(cos(f*x + e) + 1)^3 + 3*sin(f*x + e)^4/(cos(f*x + e) + 1)^4 + 4)/(a + a*
sin(f*x + e)/(cos(f*x + e) + 1) + 2*a*sin(f*x + e)^2/(cos(f*x + e) + 1)^2 + 2*a*sin(f*x + e)^3/(cos(f*x + e) +
 1)^3 + a*sin(f*x + e)^4/(cos(f*x + e) + 1)^4 + a*sin(f*x + e)^5/(cos(f*x + e) + 1)^5) + 3*arctan(sin(f*x + e)
/(cos(f*x + e) + 1))/a) - 3*A*d^3*((sin(f*x + e)/(cos(f*x + e) + 1) + 5*sin(f*x + e)^2/(cos(f*x + e) + 1)^2 +
3*sin(f*x + e)^3/(cos(f*x + e) + 1)^3 + 3*sin(f*x + e)^4/(cos(f*x + e) + 1)^4 + 4)/(a + a*sin(f*x + e)/(cos(f*
x + e) + 1) + 2*a*sin(f*x + e)^2/(cos(f*x + e) + 1)^2 + 2*a*sin(f*x + e)^3/(cos(f*x + e) + 1)^3 + a*sin(f*x +
e)^4/(cos(f*x + e) + 1)^4 + a*sin(f*x + e)^5/(cos(f*x + e) + 1)^5) + 3*arctan(sin(f*x + e)/(cos(f*x + e) + 1))
/a) + 18*B*c^2*d*((sin(f*x + e)/(cos(f*x + e) + 1) + sin(f*x + e)^2/(cos(f*x + e) + 1)^2 + 2)/(a + a*sin(f*x +
 e)/(cos(f*x + e) + 1) + a*sin(f*x + e)^2/(cos(f*x + e) + 1)^2 + a*sin(f*x + e)^3/(cos(f*x + e) + 1)^3) + arct
an(sin(f*x + e)/(cos(f*x + e) + 1))/a) + 18*A*c*d^2*((sin(f*x + e)/(cos(f*x + e) + 1) + sin(f*x + e)^2/(cos(f*
x + e) + 1)^2 + 2)/(a + a*sin(f*x + e)/(cos(f*x + e) + 1) + a*sin(f*x + e)^2/(cos(f*x + e) + 1)^2 + a*sin(f*x
+ e)^3/(cos(f*x + e) + 1)^3) + arctan(sin(f*x + e)/(cos(f*x + e) + 1))/a) - 6*B*c^3*(arctan(sin(f*x + e)/(cos(
f*x + e) + 1))/a + 1/(a + a*sin(f*x + e)/(cos(f*x + e) + 1))) - 18*A*c^2*d*(arctan(sin(f*x + e)/(cos(f*x + e)
+ 1))/a + 1/(a + a*sin(f*x + e)/(cos(f*x + e) + 1))) + 6*A*c^3/(a + a*sin(f*x + e)/(cos(f*x + e) + 1)))/f

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 460 vs. \(2 (212) = 424\).

Time = 0.29 (sec) , antiderivative size = 460, normalized size of antiderivative = 2.09 \[ \int \frac {(A+B \sin (e+f x)) (c+d \sin (e+f x))^3}{a+a \sin (e+f x)} \, dx=\frac {\frac {3 \, {\left (2 \, B c^{3} + 6 \, A c^{2} d - 6 \, B c^{2} d - 6 \, A c d^{2} + 9 \, B c d^{2} + 3 \, A d^{3} - 3 \, B d^{3}\right )} {\left (f x + e\right )}}{a} - \frac {12 \, {\left (A c^{3} - B c^{3} - 3 \, A c^{2} d + 3 \, B c^{2} d + 3 \, A c d^{2} - 3 \, B c d^{2} - A d^{3} + B d^{3}\right )}}{a {\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1\right )}} + \frac {2 \, {\left (9 \, B c d^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{5} + 3 \, A d^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{5} - 3 \, B d^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{5} - 18 \, B c^{2} d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} - 18 \, A c d^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} + 18 \, B c d^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} + 6 \, A d^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} - 6 \, B d^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} - 36 \, B c^{2} d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 36 \, A c d^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 36 \, B c d^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 12 \, A d^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 24 \, B d^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 9 \, B c d^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 3 \, A d^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 3 \, B d^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 18 \, B c^{2} d - 18 \, A c d^{2} + 18 \, B c d^{2} + 6 \, A d^{3} - 10 \, B d^{3}\right )}}{{\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 1\right )}^{3} a}}{6 \, f} \]

[In]

integrate((A+B*sin(f*x+e))*(c+d*sin(f*x+e))^3/(a+a*sin(f*x+e)),x, algorithm="giac")

[Out]

1/6*(3*(2*B*c^3 + 6*A*c^2*d - 6*B*c^2*d - 6*A*c*d^2 + 9*B*c*d^2 + 3*A*d^3 - 3*B*d^3)*(f*x + e)/a - 12*(A*c^3 -
 B*c^3 - 3*A*c^2*d + 3*B*c^2*d + 3*A*c*d^2 - 3*B*c*d^2 - A*d^3 + B*d^3)/(a*(tan(1/2*f*x + 1/2*e) + 1)) + 2*(9*
B*c*d^2*tan(1/2*f*x + 1/2*e)^5 + 3*A*d^3*tan(1/2*f*x + 1/2*e)^5 - 3*B*d^3*tan(1/2*f*x + 1/2*e)^5 - 18*B*c^2*d*
tan(1/2*f*x + 1/2*e)^4 - 18*A*c*d^2*tan(1/2*f*x + 1/2*e)^4 + 18*B*c*d^2*tan(1/2*f*x + 1/2*e)^4 + 6*A*d^3*tan(1
/2*f*x + 1/2*e)^4 - 6*B*d^3*tan(1/2*f*x + 1/2*e)^4 - 36*B*c^2*d*tan(1/2*f*x + 1/2*e)^2 - 36*A*c*d^2*tan(1/2*f*
x + 1/2*e)^2 + 36*B*c*d^2*tan(1/2*f*x + 1/2*e)^2 + 12*A*d^3*tan(1/2*f*x + 1/2*e)^2 - 24*B*d^3*tan(1/2*f*x + 1/
2*e)^2 - 9*B*c*d^2*tan(1/2*f*x + 1/2*e) - 3*A*d^3*tan(1/2*f*x + 1/2*e) + 3*B*d^3*tan(1/2*f*x + 1/2*e) - 18*B*c
^2*d - 18*A*c*d^2 + 18*B*c*d^2 + 6*A*d^3 - 10*B*d^3)/((tan(1/2*f*x + 1/2*e)^2 + 1)^3*a))/f

Mupad [B] (verification not implemented)

Time = 14.29 (sec) , antiderivative size = 839, normalized size of antiderivative = 3.81 \[ \int \frac {(A+B \sin (e+f x)) (c+d \sin (e+f x))^3}{a+a \sin (e+f x)} \, dx=\text {Too large to display} \]

[In]

int(((A + B*sin(e + f*x))*(c + d*sin(e + f*x))^3)/(a + a*sin(e + f*x)),x)

[Out]

-(12*A*c^3*cos(e/2 + (f*x)/2) - 18*A*d^3*cos(e/2 + (f*x)/2) - 12*B*c^3*cos(e/2 + (f*x)/2) + 18*B*d^3*cos(e/2 +
 (f*x)/2) + 6*A*d^3*cos(e/2 + (f*x)/2)^3 - 12*A*d^3*cos(e/2 + (f*x)/2)^5 - 6*B*d^3*cos(e/2 + (f*x)/2)^3 + 36*B
*d^3*cos(e/2 + (f*x)/2)^5 - 16*B*d^3*cos(e/2 + (f*x)/2)^7 - 9*A*d^3*cos(e/2 + (f*x)/2)*(e + f*x) - 6*B*c^3*cos
(e/2 + (f*x)/2)*(e + f*x) + 9*B*d^3*cos(e/2 + (f*x)/2)*(e + f*x) - 9*A*d^3*sin(e/2 + (f*x)/2)*(e + f*x) - 6*B*
c^3*sin(e/2 + (f*x)/2)*(e + f*x) + 9*B*d^3*sin(e/2 + (f*x)/2)*(e + f*x) - 18*A*d^3*cos(e/2 + (f*x)/2)^2*sin(e/
2 + (f*x)/2) + 12*A*d^3*cos(e/2 + (f*x)/2)^4*sin(e/2 + (f*x)/2) + 18*B*d^3*cos(e/2 + (f*x)/2)^2*sin(e/2 + (f*x
)/2) + 12*B*d^3*cos(e/2 + (f*x)/2)^4*sin(e/2 + (f*x)/2) - 16*B*d^3*cos(e/2 + (f*x)/2)^6*sin(e/2 + (f*x)/2) + 3
6*A*c*d^2*cos(e/2 + (f*x)/2) - 36*A*c^2*d*cos(e/2 + (f*x)/2) - 54*B*c*d^2*cos(e/2 + (f*x)/2) + 36*B*c^2*d*cos(
e/2 + (f*x)/2) + 36*A*c*d^2*cos(e/2 + (f*x)/2)^3 + 18*B*c*d^2*cos(e/2 + (f*x)/2)^3 + 36*B*c^2*d*cos(e/2 + (f*x
)/2)^3 - 36*B*c*d^2*cos(e/2 + (f*x)/2)^5 + 18*A*c*d^2*cos(e/2 + (f*x)/2)*(e + f*x) - 18*A*c^2*d*cos(e/2 + (f*x
)/2)*(e + f*x) - 27*B*c*d^2*cos(e/2 + (f*x)/2)*(e + f*x) + 18*B*c^2*d*cos(e/2 + (f*x)/2)*(e + f*x) + 18*A*c*d^
2*sin(e/2 + (f*x)/2)*(e + f*x) - 18*A*c^2*d*sin(e/2 + (f*x)/2)*(e + f*x) - 27*B*c*d^2*sin(e/2 + (f*x)/2)*(e +
f*x) + 18*B*c^2*d*sin(e/2 + (f*x)/2)*(e + f*x) + 36*A*c*d^2*cos(e/2 + (f*x)/2)^2*sin(e/2 + (f*x)/2) - 54*B*c*d
^2*cos(e/2 + (f*x)/2)^2*sin(e/2 + (f*x)/2) + 36*B*c^2*d*cos(e/2 + (f*x)/2)^2*sin(e/2 + (f*x)/2) + 36*B*c*d^2*c
os(e/2 + (f*x)/2)^4*sin(e/2 + (f*x)/2))/(6*a*f*cos(e/2 + (f*x)/2) + 6*a*f*sin(e/2 + (f*x)/2))